﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ImplementationInitialization
{
    public class Logger
    {
        static readonly string Log_File = "Import.log";

        public static void WriteLog(string message)
        {
            if (!File.Exists(Log_File))
            {
                using (FileStream f = new FileStream(Log_File, FileMode.Create)) { }
            }

            using (FileStream fs = new FileStream(Log_File, FileMode.Append))
            {
                StreamWriter sw = new StreamWriter(fs, Encoding.Default);

                //开始写入
                sw.WriteLine(message);

                sw.Close();
                fs.Close();
            }
        }
    }
}
